package com.knowif.backend.dto;

import com.knowif.pojo.InterviewExperience;
import com.knowif.pojo.TUser;
import lombok.Data;
import org.springframework.util.CollectionUtils;

import java.util.List;

@Data
public class InterviewExperienceDto {

    private InterviewExperience interviewExperience;
    private TUser tUser;

    public static void andTUser(List<InterviewExperienceDto> interviewExperienceDtos, List<TUser> tUsers) {
        if(!CollectionUtils.isEmpty(interviewExperienceDtos) && !CollectionUtils.isEmpty(tUsers)){
            interviewExperienceDtos.forEach(dto -> {
                tUsers.forEach(tu -> {
                    if(tu.getId().equals(dto.getInterviewExperience().getUserId())){
                        dto.setTUser(tu);
                    }
                });
            });
        }
    }
}
